package com.itheima.day10;

public class day10_Test2 {
    public static void main(String[] args) {
        String s1 = "    good good study,  day day up   ";
        System.out.println("s1= " + s1);
        String s2 = s1.toUpperCase();
        System.out.println("s2= " + s2);

        String s3 = s2.toLowerCase();
        System.out.println("s3= " + s3);

        String trim = s1.trim();
        System.out.println("trim = " + trim);

        String s4 = "锄禾日当午,汗滴禾下土";
        boolean flag = s4.contains("土");
        System.out.println("flag = " + flag);

        String name = "德玛西亚";
        boolean flag1 = name.startsWith("德玛");
        System.out.println("flag1 = " + flag1);

        boolean flag2 = name.endsWith("西亚");
        System.out.println("flag2 = " + flag2);

        String msg = "超级黑化肥黑挥发会发黑";

        int firstIndex = msg.indexOf("黑");

        System.out.println("firstIndex = " +firstIndex);

        int lastIndex = msg.lastIndexOf("黑");
        System.out.println("lastIndex = " +lastIndex);
    }
}
